/*************************************************************
 * File: Status.java
 * Author: Huang Shaobin
 * Email: Shaobin.Software@gmail.com Shaobin_Software@163.com 
 * Date: Jan 31, 2013 4:54:19 AM
 * Description: 
 * Copyright (c) 2012
 ************************************************************/
package snow.core.enums;

import snow.core.Constants;

/**
 *
 */
public enum Status {

	FAILURE(Constants.STATUS_FAILURE), SUCCESS(Constants.STATUS_SUCCESS);

	public static Status toStatusFrom(Integer value) {
		if (Constants.STATUS_SUCCESS.equals(value)) {
			return SUCCESS;
		} else if (Constants.STATUS_FAILURE.equals(value)) {
			return FAILURE;
		}
		return null;
	}

	private final Integer value;

	private Status(Integer value) {
		this.value = value;
	}

	public Integer getValue() {
		return this.value;
	}
}
